import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { MongooseModule } from '@nestjs/mongoose';
import { CommandModule } from 'nestjs-command';
import { WorkflowModule } from './workflow/workflow.module';
import { TemplateModule } from './templates/template.module';
import { DatabaseModule } from './database/database.module';
import { databaseConfig } from './config/database.config';
import { UploadModule } from './upload/upload.module';
import { ComfyUIModule } from './comfyui/comfyui.module';
import { GenerationGateway } from './gateways/generation.gateway';
import { UsersModule } from './users/users.module';
import { AuthModule } from './auth/auth.module';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
    }),
    MongooseModule.forRoot(process.env.MONGODB_URI || 'mongodb://localhost/ai-platform'),
    CommandModule,
    DatabaseModule,
    WorkflowModule,
    TemplateModule,
    UploadModule,
    ComfyUIModule,
    UsersModule,
    AuthModule
  ],
  providers: [GenerationGateway]
})
export class AppModule { }